#include "vector3d.h"

Vector3D::Vector3D() : Object3D()
{

}

Vector3D::Vector3D(const Vector3D &vector3d) : Object3D(vector3d)
{

}

Vector3D::Vector3D(const double &_x, const double &_y, const double &_z) : Object3D(_x,_y,_z)
{

}

inline double Vector3D::operator*(const Vector3D &v) const
{
    return (v.x*x+v.y*y+v.z*z);
}

inline Vector3D Vector3D::operator*(const double &k) const
{
    return Vector3D(x*k,y*k,z*k);
}


inline Vector3D Vector3D::operator+(const Vector3D &v) const
{
    return Vector3D(x+v.x, y+v.y, z+v.z);
}

inline Vector3D Vector3D::operator-(const Vector3D &v) const
{
    return Vector3D(x-v.x, y-v.y, z-v.z);
}

inline void Vector3D::normalize()
{
    double denom(sqrt(x*x+y*y+z*z));
    x/=denom;
    y/=denom;
    z/=denom;
}

inline double Vector3D::norm()  const
{
    return sqrt(x*x+y*y+z*z);
}

inline double Vector3D::norm2() const
{
    return (x*x+y*y+z*z);
}

inline void Vector3D::incX()
{
    x++;
}

inline void Vector3D::incY()
{
    y++;
}

inline void Vector3D::incZ()
{
    z++;
}
